/**
 * Copyright phonemap.com
 *
 * Licensed under the phonemap.com License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.phonemap.com/licenses/LICENSE-1.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * Constructor.
 */
function PhonemapGlobal() {
	
}

/**
 * Global variable.
 */

/**
 * Sets Cur Position.
 * 
 * @param pos {type: google.maps.LatLng}
 */
PhonemapGlobal.setCurPos = function(pos) {
	var value = pos.lat() + ',' + pos.lng();
	localStorage.setItem('curPos', value);
}

/**
 * Gets Cur Position.
 * 
 * @returns {google.maps.LatLng}
 */
PhonemapGlobal.getCurPos = function() {
	var pos = localStorage.getItem('curPos');
	if (pos != null && pos != 'undefined' && pos != '') {
		return PhonemapUtil.getLatLng(pos);
	}
	return null;
}

/**
 * Sets user id.
 * 
 * @param pos {String}
 */
PhonemapGlobal.setUserId = function(userId) {
	
	localStorage.setItem('userId', userId);
}

/**
 * Gets user id.
 * 
 * @returns {String}
 */
PhonemapGlobal.getUserId = function() {
	var userId = localStorage.getItem('userId');
	if (userId != null && userId != 'undefined' && userId != '') {
		return userId;
	}
	return null;
}

/**
 * Sets timezone.
 * 
 * @param pos {String}
 */
PhonemapGlobal.setTimezone = function(timezone) {
	
	localStorage.setItem('timezone', timezone);
}

/**
 * Gets timezone.
 * 
 * @returns {String}
 */
PhonemapGlobal.getTimezone = function() {
	var timezone = localStorage.getItem('timezone');
	if (timezone != null && timezone != 'undefined' && timezone != '') {
		return timezone;
	}
	return null;
}

/**
 * Sets timezone.
 * 
 * @param pos {String}
 */
PhonemapGlobal.setCurPage = function(curPage) {
	
	localStorage.setItem('curPage', curPage);
}

/**
 * Gets timezone.
 * 
 * @returns {String}
 */
PhonemapGlobal.getCurPage = function() {
	var curPage = localStorage.getItem('timezone');
	if (curPage != null && curPage != 'undefined' && curPage != '') {
		return curPage;
	}
	return null;
}





